/*
 * @Author: long
 * @Date: 2021-09-15 10:49:58
 * @LastEditTime: 2021-10-15 10:42:24
 * @LastEditors: Please set LastEditors
 * @Description: 脸库管理
 * @FilePath: \ant-design-vue-jeecge:\hjimi\人脸辨识云\html\gitlab\pc\facecloudwebsite\src\api\face-recognition\face.js
 */
import request from '@/utils/request'
const FACE = 'api/v1/faceid/library/'
const FACE_C = 'api/v1/faceid/'

/**
* @description: 创建目标库
*/
export function createLibrary(params) { return request({ url: FACE, method: 'POST', data: params, headers: {'Content-Type': 'application/json'} }) }

/**
* @description: 查询目标库
*/
export function libraryList(params) { return request({ url: FACE, method: 'GET', params }) } 

/**
* @description: 修改目标库名称
*/
export function editLibraryName(params) { return request({ url: `${FACE}rename`, method: 'POST', data: params, headers: {'Content-Type': 'application/json'} }) } 

/**
* @description: 查询最大的图片数量
*/
export function queryMaxCount(params) { return request({ url: `${ FACE }maxcount`, method: 'GET', params }) }

/**
* @description: 查询脸库图片列表
*/
export function getLibraryimage(params) { return request({ url: `${ FACE_C }libraryimage`, method: 'GET', params }) }

/**
* @description: 删除/清空目标库
*/
export function deleteLibrary(params, code) { return request({ url: `${ FACE }${ code }`, method: 'DELETE', params }) }

/**
* @description: 获取单张人脸图片
*/
export function getFaceImage(code, imageId) { return request({ url: `${ FACE }/face?libraryCode=${ code }&imageId=${ imageId }`, method: 'GET' }) }

/**
* @description: 删除单张人脸图片
*/
export function deleteFaceImage(code, imageId) { return request({ url: `${ FACE }face?libraryCode=${ code }&imageId=${ imageId }`, method: 'DELETE' }) }

/**
* @description: 人脸上传
*/
export function faceUpload(params) { return  request({ url: `${ FACE }import/face`, method: 'POST', data: params })}

/**
* @description: 人脸属性
*/
export function faceAttribute(params) { return request({ url: `${ FACE_C }face/attribute`, method: 'POST', params }) }